export const localStorage = {
    set:(key:string,value:any)=>{
        window.localStorage.setItem(key,JSON.stringify(value))
    },
    get:(key:string)=>{
        const data = window.localStorage.getItem(key)||''
        return data?JSON.parse(data):''
    },
    remove:(key:string)=>{
        window.localStorage.remove(key)
    },
    clear:()=>{
        window.localStorage.clear()
    }
}

export const sessionStorage = {
    set:(key:string,value:any)=>{
        window.sessionStorage.setItem(key,JSON.stringify(value))
    },
    get:(key:string)=>{
        const data = window.sessionStorage.getItem(key)||''
        return data?JSON.parse(data):''
    },
    remove:(key:string)=>{
        window.sessionStorage.remove(key)
    },
    clear:()=>{
        window.sessionStorage.clear()
    }
}



